package com.example.threaddemo;

import java.util.concurrent.ArrayBlockingQueue;

public class BlockingQueueDemo {
    public static void main(String[] args) {


        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<String>(3);
        queue.add("1");
        queue.add("2");
        queue.add("3");

        System.out.println(queue.element());
        System.out.println(queue.remove());
        System.out.println(queue.remove());
        System.out.println(queue.remove());
        System.out.println(queue.remove());
    }
}
